home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_gen / vbxwzrd / redgreen.h# < prev    next >
Encoding:
Text File  |  1995-02-19  |  5.4 KB  |  147 lines

  1. //---------------------------------------------------------------------------
  2. // RedGreen.h
  3. //---------------------------------------------------------------------------
  4.  
  5. //---------------------------------------------------------------------------
  6. // Resource Information
  7. //---------------------------------------------------------------------------
  8. // Toolbox bitmap resource IDs numbers.
  9. //---------------------------------------------------------------------------
  10. #define IDBMP_RedGreen            8000
  11. #define IDBMP_RedGreenDOWN        8001
  12. #define IDBMP_RedGreenMONO        8003
  13. #define IDBMP_RedGreenEGA         8006
  14.  
  15. //---------------------------------------------------------------------------
  16. // Update these fields for each build.
  17. //---------------------------------------------------------------------------
  18. #define VBX_VERSION                3,00,0,00
  19. #define VBX_VERSION_STR            "3.00.000"
  20.  
  21. #ifndef RC_INVOKED
  22. //---------------------------------------------------------------------------
  23. // Macro for referencing member of structure
  24. //---------------------------------------------------------------------------
  25. #define OFFSETIN(struc,field)      ((USHORT)&(((struc *)0)->field))
  26.  
  27.  
  28. //---------------------------------------------------------------------------
  29. // Control Procedure
  30. //---------------------------------------------------------------------------
  31. LONG FAR PASCAL _export RedGreenCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  32.  
  33. //---------------------------------------------------------------------------
  34. // RedGreen control data and structs
  35. //---------------------------------------------------------------------------
  36. typedef struct tagRedGreen
  37.     {
  38.     ENUM    About;
  39.     BOOL    Value;
  40.     } RedGreen;
  41.  
  42. typedef RedGreen FAR * LPRedGreen;
  43.  
  44. #define LpRedGreenDEREF(hctl)          ((LPRedGreen)VBDerefControl(hctl))
  45.  
  46.  
  47. //---------------------------------------------------------------------------
  48. // Property info
  49. //---------------------------------------------------------------------------
  50.  
  51. PROPINFO Property_About =
  52.     {
  53.     "About",
  54.     DT_ENUM | PF_fGetData | PF_fSetMsg | PF_fSetMsg,
  55.     OFFSETIN(RedGreen, About),    0,
  56.     0,
  57.     "Click on ""..."" for About Box\0",
  58.     0
  59.     };
  60.  
  61. PROPINFO Property_Value =
  62.     {
  63.     "Value",
  64.     DT_BOOL | PF_fGetData | PF_fSaveData | PF_fSetData | PF_fSetMsg,
  65.     OFFSETIN(RedGreen, Value),
  66.     0, 0,  NULL, 0
  67.     };
  68.  
  69.  
  70. //---------------------------------------------------------------------------
  71. // Property list
  72. //---------------------------------------------------------------------------
  73. // Define the consecutive indicies for the properties
  74. //---------------------------------------------------------------------------
  75. #define IPROP_RedGreen_CTLNAME              0
  76. #define IPROP_RedGreen_HWND              1
  77. #define IPROP_RedGreen_INDEX              2
  78. #define IPROP_RedGreen_About              3
  79. #define IPROP_RedGreen_ENABLED              4
  80. #define IPROP_RedGreen_HEIGHT              5
  81. #define IPROP_RedGreen_LEFT              6
  82. #define IPROP_RedGreen_TOP              7
  83. #define IPROP_RedGreen_VISIBLE              8
  84. #define IPROP_RedGreen_WIDTH              9
  85. #define IPROP_RedGreen_Value              10
  86.  
  87. PPROPINFO RedGreen_Properties[] =
  88.     {
  89.     PPROPINFO_STD_CTLNAME,
  90.     PPROPINFO_STD_HWND,
  91.     PPROPINFO_STD_INDEX,
  92.     &Property_About,
  93.     PPROPINFO_STD_ENABLED,
  94.     PPROPINFO_STD_HEIGHT,
  95.     PPROPINFO_STD_LEFT,
  96.     PPROPINFO_STD_TOP,
  97.     PPROPINFO_STD_VISIBLE,
  98.     PPROPINFO_STD_WIDTH,
  99.     &Property_Value,
  100.     NULL
  101.     };
  102.  
  103.  
  104. //---------------------------------------------------------------------------
  105. // Event info
  106. //---------------------------------------------------------------------------
  107.  
  108. //---------------------------------------------------------------------------
  109. // Event list
  110. //---------------------------------------------------------------------------
  111. // Define the consecutive indicies for the events
  112. //---------------------------------------------------------------------------
  113. #define IEVENT_RedGreen_MOUSEMOVE            0
  114.  
  115. PEVENTINFO 
  116. RedGreen_Events[] =
  117.     {
  118.     PEVENTINFO_STD_MOUSEMOVE,
  119.     NULL
  120.     };
  121.  
  122.  
  123. //---------------------------------------------------------------------------
  124. // Model struct
  125. //---------------------------------------------------------------------------
  126. // Define the control model (using the event and property structures).
  127. //---------------------------------------------------------------------------
  128. MODEL modelRedGreen =
  129.     {
  130.     VB_VERSION,                         // VB version being used
  131.     0,  // MODEL flags
  132.     (PCTLPROC)RedGreenCtlProc,            // Control procedure
  133.     0 | CS_HREDRAW | CS_VREDRAW,  // Class style
  134.     0L,  // Default Windows style
  135.     sizeof(RedGreen),                       // Size of CIRC structure
  136.     IDBMP_RedGreen,                       // Palette bitmap ID
  137.     "RedGreen",                           // Default control name
  138.     "RedGreen",                            // Visual Basic class name
  139.     NULL,                               // Parent class name
  140.     RedGreen_Properties,                  // Property information table
  141.     RedGreen_Events,                      // Event information table
  142.     0,                                  // Default property
  143.     0,                                  // Default event
  144.     };
  145. #endif  // RC_INVOKED
  146. //---------------------------------------------------------------------------
  147.